home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Source Code / Visual Basic Source Code.iso / vbsource / exitwi / exitdlg.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1995-12-05  |  4.2 KB  |  154 lines

  1. VERSION 2.00
  2. Begin Form ExitDlg 
  3.    BackColor       =   &H00C0C0C0&
  4.    BorderStyle     =   3  'Fixed Double
  5.    Caption         =   "Windows Exit"
  6.    ClientHeight    =   1590
  7.    ClientLeft      =   1485
  8.    ClientTop       =   1815
  9.    ClientWidth     =   4455
  10.    ForeColor       =   &H00000000&
  11.    Height          =   2280
  12.    Left            =   1425
  13.    LinkMode        =   1  'Source
  14.    LinkTopic       =   "Form2"
  15.    MaxButton       =   0   'False
  16.    MinButton       =   0   'False
  17.    ScaleHeight     =   1590
  18.    ScaleWidth      =   4455
  19.    Top             =   1185
  20.    Width           =   4575
  21.    Begin CommandButton Command5 
  22.       Caption         =   "&Quit"
  23.       Height          =   375
  24.       Left            =   3360
  25.       TabIndex        =   6
  26.       Top             =   720
  27.       Width           =   855
  28.    End
  29.    Begin CommandButton Command4 
  30.       Caption         =   "O&K"
  31.       Height          =   375
  32.       Left            =   240
  33.       TabIndex        =   5
  34.       Top             =   720
  35.       Width           =   855
  36.    End
  37.    Begin CommandButton Command3 
  38.       Caption         =   "Re&boot System"
  39.       Height          =   495
  40.       Left            =   3000
  41.       TabIndex        =   4
  42.       Top             =   120
  43.       Width           =   1455
  44.    End
  45.    Begin CommandButton Command2 
  46.       Caption         =   "&Restart Windows"
  47.       Height          =   495
  48.       Left            =   1320
  49.       TabIndex        =   3
  50.       Top             =   120
  51.       Width           =   1695
  52.    End
  53.    Begin CommandButton Exit 
  54.       Caption         =   "E&xit Windows"
  55.       Height          =   495
  56.       Left            =   0
  57.       TabIndex        =   2
  58.       Top             =   120
  59.       Width           =   1335
  60.    End
  61.    Begin CommandButton cmd_Cancel 
  62.       Cancel          =   -1  'True
  63.       Caption         =   "&Cancel"
  64.       Height          =   375
  65.       HelpContextID   =   102
  66.       Left            =   1800
  67.       TabIndex        =   0
  68.       Top             =   720
  69.       Width           =   975
  70.    End
  71.    Begin CheckBox check_OnTop 
  72.       BackColor       =   &H00C0C0C0&
  73.       Caption         =   "Always On Top"
  74.       ForeColor       =   &H00FF0000&
  75.       Height          =   255
  76.       HelpContextID   =   103
  77.       Left            =   1440
  78.       TabIndex        =   1
  79.       Top             =   1320
  80.       Width           =   1695
  81.    End
  82.    Begin Menu Quit 
  83.       Caption         =   "&Quit"
  84.    End
  85.    Begin Menu About 
  86.       Caption         =   "&About"
  87.    End
  88. Sub About_Click ()
  89.     Aboutbox.Show Modal
  90. End Sub
  91. Sub check_OnTop_Click ()
  92. Dim R As Integer
  93.     If check_OnTop.Value Then
  94.         SetWindowPos ExitWin.hWnd, HWND_TOPMOST, 0, 0, 0, 0, &H40
  95.     Else
  96.         SetWindowPos ExitWin.hWnd, HWND_NOTOPMOST, 0, 0, 0, 0, &H40
  97.     End If
  98.     Exitdlg.SetFocus
  99.     R = WriteProfileString(APP_EXITWIN, KEY_ONTOP, Trim$(Str$(check_OnTop.Value)))
  100. End Sub
  101. Sub cmd_Cancel_Click ()
  102.     UnloadExitwindlg
  103. End Sub
  104. Sub Command1_Click ()
  105. R = ExitWindows(&H0, 0)
  106. End Sub
  107. Sub Command2_Click ()
  108. R = ExitWindows(EW_RESTARTWINDOWS, &H0)
  109. End Sub
  110. Sub Command3_Click ()
  111. R = ExitWindows(EW_REBOOTSYSTEM, &H0)
  112. End Sub
  113. Sub Command4_Click ()
  114.     UnloadExitwindlg
  115. End Sub
  116. Sub Command5_Click ()
  117.         End
  118. End Sub
  119. Sub End_Click ()
  120.     End
  121. End Sub
  122. Sub Exit_Click ()
  123. R = ExitWindows(&H0, 0)
  124. End Sub
  125. Sub Exwin_Click ()
  126. R = ExitWindows(&H0, 0)
  127. End Sub
  128. Sub Form_Load ()
  129.     Move (Screen.Width - Width) / 2, (Screen.Height - Height) / 2
  130.     RemoveSysMenuItems Exitdlg
  131.     Show
  132.     check_OnTop.Value = OnTop
  133. End Sub
  134. Sub Quit_Click ()
  135.     End
  136. End Sub
  137. Sub RebootComputer_Click ()
  138. R = ExitWindows(EW_REBOOTSYSTEM, &H0)
  139. End Sub
  140. Sub RemoveSysMenuItems (AForm As Form)
  141. Dim HSysMenu As Integer, R As Integer
  142.     HSysMenu = GetSystemMenu(AForm.hWnd, 0)
  143.     R = RemoveMenu(HSysMenu, 8, MF_BYPOSITION)
  144.     R = RemoveMenu(HSysMenu, 7, MF_BYPOSITION)
  145.     R = RemoveMenu(HSysMenu, 5, MF_BYPOSITION)
  146. End Sub
  147. Sub RestartWindows_Click ()
  148. R = ExitWindows(EW_RESTARTWINDOWS, &H0)
  149. End Sub
  150. Sub UnloadExitwindlg ()
  151.     Unload Exitdlg
  152.     ExitWin.Picture = ExitWin.pic_Closed.Picture
  153. End Sub
  154.